package com.caiyi.financial.nirvana.sms.gateway.sgip.message.body;

import com.caiyi.financial.nirvana.sms.gateway.sgip.message.SGIPBody;
import io.netty.buffer.ByteBuf;

/**
 * submit_resp消息
 */
public class SGIPSubmitResp extends SGIPBody {

    private byte result;


    @Override
    public int encode(ByteBuf buffer) {
        throw new UnsupportedOperationException("不支持编码操作");
    }


    @Override
    public SGIPBody decode(ByteBuf buffer) {
        if (buffer.readableBytes() < 9)
            throw new IllegalAccessError("可读字节过小,不足以支持解码");

        this.result = buffer.readByte();
        buffer.readBytes(8);
        return this;
    }

    /**
     * @return the result
     */
    public int getResult() {
        return result;
    }
}
